
@import "../_variables.scss";

$header-height: 40px;

.fc-calendar-container {
	position: relative;

	width: 100%;

  background-color: $white;
}

.fc-four-rows .fc-row  {
	height: 25%;
}

.fc-five-rows .fc-row  {
	height: 20%;
}

.fc-six-rows .fc-row {
	height: 16.66%;
	height: calc(100%/6);
}

.fc-calendar {
	width: 100%;
	height: 100%;

  .fc-head {
	  height: $header-height;
	  line-height: $header-height;

    border: 1px solid $border-color;
    border-bottom: transparent;
    background-color: $gray-100;

    text-transform: uppercase;
    font-weight: bold;
    color: $text-muted;
  }

  .fc-body {
	  position: relative;
	  width: 100%;
	  height: 100%;
	  height: calc(100% - #{$header-height});
	  border: 1px solid $border-color;
  }

  .fc-row {
	  width: 100%;
	  border-bottom: 1px solid $border-color;
  }

  .fc-row .fc-cell,
  .fc-head .fc-cell {
	  float: left;
	  height: 100%;
	  width:  14.28%; /* 100% / 7 */
	  position: relative;
    border-right: 1px solid $border-color;
  }


  .fc-row .fc-cell {
	  padding: 4px;
	  overflow: hidden;
	  position: relative;
  }

  .fc-head .fc-cell {
	  text-align: center;
  }

  .fc-row .fc-cell:last-child,
  .fc-head .fc-cell:last-child {
	  border-right: none;
  }


  .fc-row::after{
    content: "";
    display: block;
    clear: both;
  }

  .fc-row:last-child {
	  border-bottom: none;
  }

  .fc-date {
	  position: absolute;
	  width: 30px;
	  height: 20px;
	  top: 5px;
	  right: 5px;
	  text-align: right;

    font-size: 1.2rem;
    color: $text-muted-dark;

    &.fc-emptydate{
      color: #ccc;
    }
  }

  time {
	  display: none;
  }

  .fc-weekday {
	  padding-left: 5px;
	  display: none;
  }

  .fc-today{
    background: #fff4c3;
    .fc-date {
      font-weight: bold;
      color: $blue;
    }
  }

  .fc-out {
	  opacity: 0.6;
  }

  

  .fc-calendar-events{
    height: calc(100% - 30px);
    margin-top: 30px;
    overflow: hidden;
    padding: 0 10px;

    .event-item{
      display: flex;
      line-height: 1.2;

      .event-badge{
        flex-basis: 40px;
        width: 40px;
        font-weight: bold;
      }

      .event-title{
        flex-grow: 1;
      }
    }
  }
  
}

.fc-datepicker{
  height: auto;
  .fc-calendar{

    .fc-head {
      font-weight: normal;
      font-size: 0.8rem;
      border: none;
      background: none;
      border-bottom: solid 1px $border-color;
      margin-bottom: 10px;

      .fc-cell{
        border: none;
        padding: 0;
      }
    }

    .fc-body{
      border: none;
    }

    .fc-row {
      height: auto !important;
      border: none;
    }

    .fc-cell{
      padding: 0;
      padding-top: 14.28%;
      height: auto;
      border: none;

      .fc-cell-content{
        width: 90%;
        height: 90%;

        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);

        border-radius: 50%;
        animation: background 0.2s;

        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
      }

      &:hover, &.fc-selected, &.fc-selected:hover{
        .fc-cell-content{
          background-color: $blue;
          .fc-date{
            color: $white;
            font-weight: bold;
          }
        }
      }
    }

    .fc-date {
      font-size: 1rem;
      line-height: 1;
      
      position: static;
      top: 0;
      right: 0;

      width: auto;
      height: auto;

      display: flex;
      align-items: center;
      justify-content: center;


    }

    .fc-today{
      background: none;

      .fc-date {
        font-weight: bold;
        color: $blue;
        flex-direction: column;

        &::after{
          display: block;
          content: "";
          width: 100%;
          border-top: solid 2px $blue;
        }
      }
    }
    
  }
}

.no-select .fc-calendar{
  .fc-cell:hover{
    .fc-cell-content{
      background-color: inherit;

      .fc-date{
        color: inherit;
        font-weight: inherit;
      }
    }
  }
}


.fc-event-dot .fc-calendar{

  .fc-date{
    margin-bottom: 8px;
  }

  .fc-content{
    .fc-date{
      margin-bottom: 0;
    }
  }

  .fc-calendar-events{
    padding: 0;
    margin: 0;
    margin-top: 3px;
    width: auto;
    height: auto;

    display: flex;
    justify-content: center;

    .fc-calendar-event{
      line-height: 10px;
      display: block;
      margin: 0 1px;
    }

    .event-dot{
      width: 5px;
      height: 5px;
      border-radius: 50%;
      display: block;
    }
  }
}
